<?xml version='1.0' encoding='UTF-8' ?> 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:p="http://primefaces.org/ui"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:c="http://java.sun.com/jsp/jstl/core">
    <!--Inicia la composicion de la pagina en la plantilla-->
    <ui:composition template="/resource/template/plantilla.xhtml">

        <!--Segmento que define el contenido del header-->
        <ui:define name="head">
            <h:head>
                person.mail
                <f:loadBundle basename="person.mail.label_#{logged.loggedIdiom}" var="label" />
                <f:loadBundle basename="person.mail.message_#{logged.loggedIdiom}" var="message" />
                <f:loadBundle basename="person.mail.help_#{logged.loggedIdiom}" var="help" />
                <script>
                    function verificar(dato)
                    {
                        var agree = confirm(dato);
                        if (agree)
                            return true;
                        else
                            return false;
                    }
                </script>

            </h:head>
        </ui:define>
        <ui:define name="content">
            <h:body>
                <h:form id="formPersona" >  
                    <!--PARA -->
                    <div class="field">
                        <h:outputText value="#{label.field1}" class="label"/> 
                        <h:inputText id="titulo" class="textfield" value="#{person_mail.destinatario}" size="50" maxlength="200" required="#{param['required']=='true'}" requiredMessage="#{message.m20}"/>
                        <h:outputText class="required" value="*"/>
                    </div>

                    <div class="field">
                        <h:outputText value="#{label.field2}" class="label"/>
                        <br/> 
                        <h:inputTextarea value="#{person_mail.mensaje}" style="width: 100%;height: 100px;"/>
                    </div>
                    <h:commandButton value="#{label.button1}" class="button" 
                                     actionListener="#{person_mail.sendMail()}" 
                                     rendered="#{access.add}" onclick="return verificar('#{message.m7}')">
                        <f:param name="required" value="true"/>
                    </h:commandButton>

                </h:form>

            </h:body>
        </ui:define>

    </ui:composition>
</html>